<#include "/component/datetime.html" />
<style>
.main_Receipt_table_m table td{
	text-align: left;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
	grading.bindEvent();
});
</script>
<div class="ibox">
	<!-- 增加及删除按钮 -->
	<div class="ibox-title fj-angroup2">
        <h5><#if data.id??><@spring.message code='button.edit'/><#else><@spring.message code='button.new'/></#if></h5>
        <div class="ibox-tools">
            <a id="addData">
                <i class="fa fa-plus-circle fa-lg text-warning"></i>
            </a>
            <#if data.id??>
            <a id="del">
                <i class="fa fa-trash fa-lg text-danger"></i>
            </a>
            </#if>
        </div>
	</div>
	<!-- 增加及删除按钮end -->
	<!-- 输入框和展示部分 -->
	<div class="ibox-content fj-blog2">
	    <form method="post" id="editdata" action="${basePath}/grading/data/save" class="form-horizontal">
	    	<input type="hidden" name="id" value="${data.id!}" />
			<input type="hidden" name="ruleId" value="${ruleId!}" />
			<input type="hidden" id="isDraft" value="true" />
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='search.name'/>：</label>
	            <div class="col-sm-10" id="name">
	            	<#if data.typeId != '0' || isRoot>
					<input type="text" class="form-control" value="${data.name!}" name="name" />
					<#else>
						<select name="name" class="form-control m-b">
						<#if osdList??>
						<#list osdList as item>
							<option value="${item.name!}" <#if item.name == data.name>selected="selected"</#if>>${item.name!}</option>
						</#list>
						</#if>
						</select>
					</#if>
	            </div>
	        </div>
	        <div class="hr-line-dashed"></div>
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='role.type'/>：</label>
	            <div class="col-sm-10">
	            	<#if data.id??>
			    	<p class="form-control-static">${data.typeName!}</p>
			    	<#else>
					<select name="typeId" class="form-control m-b">
						<#if typeList??>
						<#list typeList as item>
						<option value="${item.id!}" <#if item.id == data.typeId>selected="selected"</#if>>${item.name!}</option>
						</#list>
						</#if>
					</select>
					</#if>
	            </div>
	        </div>
	        <#if !isRoot>
	        <div class="hr-line-dashed"></div>
	        <div class="form-group"><label class="col-sm-2 control-label"><@spring.message code='lun.superSet'/>：</label>
	            <div class="col-sm-10">
	            	<#if data.id??>
			    	<p class="form-control-static">${data.parentName!}</p>
			    	<#else>
			    	<input type="text" class="form-control easyui-validatebox" data-options="required:true,missingMessage:'不能为空'" id="parent" name="parent" value="${data.parentName!}" readonly="readonly"/>
			    	<input type="hidden" name="parentId" value="${data.parentId!}">
			    	</#if>
	            </div>
	        </div>
	        </#if>
	        <div class="hr-line-dashed"></div>
	        <div class="form-group">
		        <div class="col-sm-4 col-sm-offset-2" id="buttonDiv">
		            <button class="btn btn-primary" type="button" id="save" style="margin-left: 20px;"><@spring.message code='button.ok'/></button>
		            <button class="btn btn-danger" type="button" id="cancel"><@spring.message code='search.clear'/></button>
		        </div>
		    </div>
	    </form>
	</div>
	<!-- 输入框及展示部分end -->
</div>
<div id="osdListHtml" style="display: none;">
	<select name="name" class="form-control m-b">
		<#if osdList??>
		<#list osdList as item>
			<option value="${item.name!}">${item.name!}</option>
		</#list>
		</#if>
	</select>
</div>
